#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int a,b,n,m;
  cin>>n;
  while(n){
    m=0;
    cin>>b;
    while(b){
      cin>>a;
      m+=a;
      b--;
    }
    cout<<m<<endl;
    n--;
  }
}